<?php

namespace Cck\ArticlesSystem\Http\Models;

use Illuminate\Database\Eloquent\Model;

class Role extends Model
{
    protected $table = 'roles';

    protected $fillable = [
        'display_name', 'description'
    ];

    public function permissions()
    {
        return $this->belongsToMany(Permission::class, 'role_permissions')->using(RolePermission::class);
    }

    public function users()
    {
        return $this->belongsToMany(User::class, 'user_roles')->using(UserRole::class);
    }
}
